from selenium.webdriver.support.ui import Select

from selenium import webdriver
from selenium.webdriver.chrome.service import Service  # 使用路径的对象
from selenium.webdriver.common.by import By  # 导入定位的方法

service = Service('f:\\chrom\\chromedriver.exe')
driver = webdriver.Chrome(service=service)

driver.get('https://kyfw.12306.cn/otn/regist/init')  # 通过id 获取输入框

select = Select(driver.find_element(By.ID,'cardType'))

# select.select_by_visible_text('港澳居民来往内地通行证')
# select.select_by_index(4)  # 索引 第一个索引是0
# select.select_by_value('H')  # value值




